home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / doors_2 / tridv300.zip / EXAMPLE.PAS < prev    next >
Pascal/Delphi Source File  |  1993-03-28  |  5KB  |  155 lines

  1. {$M 16000, 0, 32000}
  2.  
  3. program example;
  4.  
  5. {****************************************************************************
  6.  *                                                                          *
  7.  *  This is a very basic program that will show you a few of the VERY many  *
  8.  *  functions available to the programmer using the TriDoor package.        *
  9.  *                                                                          *
  10.  *  To most effectively use and understand the unit, you should invest the  *
  11.  *  time to read the manual included in the release and then experiment     *
  12.  *  with the unit in your own programs.                                     *
  13.  *                                                                          *
  14.  ****************************************************************************}
  15.  
  16. uses
  17.   crt,
  18.   tridr60u;            { The TriDoor unit must come after the CRT unit. }
  19.  
  20.                        { Change to tridr55u for Turbo Pascal 5.5 or     }
  21.                        { tridr70u for Turbo Pascal 7.0.                 }
  22.  
  23. {* * * * * * * *}
  24.  
  25. procedure example_td_readln;
  26.  
  27. {* This procedure will show some of the td_readln() function capabilities
  28.    and features.                                                          *}
  29.  
  30. var
  31.   tempin : string;   {* input string used for this procedure *}
  32.  
  33. begin {* example_td_readln *}
  34.  
  35.   td_clrscr;
  36.  
  37.   td_writeln('This is an example of some of TriDoor''s input features.  All these||');
  38.   td_writeln('capabilities are built in and very easy to use.||');
  39.   td_writeln('-------------------------------------------------------------------||||');
  40.   
  41.   td_writeln('  This is an example of standard input -||');
  42.   td_writeln('  What do you think of TriDoor?||');
  43.   td_writeln('  -> ');
  44.   td_readln( tempin, 80, CAPS_OFF, CODE_OFF );
  45.   td_writeln('||||||');
  46.  
  47.   td_writeln('  This is an example of limited input -||');
  48.   td_writeln('  Enter your name (10 Characters Max) : ');
  49.   td_readln( tempin, 10, CAPS_OFF, CODE_OFF );
  50.   td_writeln('||||||');
  51.  
  52.   td_writeln('  This is an example of coded and limited input -||');
  53.   td_writeln('  Enter your password (12 Characters Max ) : ');
  54.   td_readln( tempin, 12, CAPS_OFF, CODE_ON );
  55.   td_writeln('  You entered the password : '+tempin+'.||||||');
  56.  
  57.   td_writeln('  This is an example of limited and upper-cased input -||');
  58.   td_writeln('                                   [------------]||');
  59.   td_writeln('  Enter name of file to download :  ');
  60.   td_readln( tempin, 12, CAPS_ON, CODE_OFF );
  61.   td_writeln('||||||');
  62.  
  63.   td_writeln('Press any key to continue : ');
  64.   tempin[1] := get_keypress;
  65.  
  66. end;  {* example_td_readln *}
  67.  
  68. {* * * * * * * *}
  69.  
  70. procedure example_ANSI;
  71.  
  72. {* This is an example of some ANSI screen controls that are built right
  73.    into the TriDoor program.  These screen controls were used to make
  74.    TriUser- a QuickBBS On-Line ANSI Utilizing User Editor.               *}
  75.  
  76. var
  77.   tempin : string;   {* input string used for this procedure *}
  78.  
  79. begin {* example_ANSI *}
  80.  
  81.   td_clrscr;
  82.  
  83.   ansi_color( BLINK_OFF, INTENSITY_ON, BLUE, BLACK );
  84.   td_writeln('This ');
  85.   ansi_color( BLINK_OFF, INTENSITY_ON, YELLOW, BLACK );
  86.   td_writeln('is ');
  87.   ansi_color( BLINK_OFF, INTENSITY_ON, GREEN, BLACK );
  88.   td_writeln('an ');
  89.   ansi_color( BLINK_OFF, INTENSITY_ON, MAGENTA, BLACK );
  90.   td_writeln('example ');
  91.   ansi_color( BLINK_OFF, INTENSITY_OFF, CYAN, BLACK );
  92.   td_writeln('of ');
  93.   ansi_color( BLINK_OFF, INTENSITY_OFF, RED, BLACK );
  94.   td_writeln('ANSI');
  95.   ansi_color( BLINK_ON, INTENSITY_ON, CYAN, BLACK );
  96.   td_writeln('!');
  97.  
  98.   ansi_gotoxy(10,10);
  99.   ansi_color( BLINK_ON, INTENSITY_ON, CYAN, BLUE );
  100.   td_writeln(' ** ANSI CONTROLS CAN BE FUN!!! ** ');
  101.  
  102.   ansi_gotoxy(1,20);
  103.   ansi_color( BLINK_OFF, INTENSITY_OFF, WHITE, BLACK );
  104.   td_writeln('Press any key to continue : ');
  105.   tempin[1] := get_keypress;
  106.  
  107. end;  {* example_ANSI *}
  108.  
  109. {* * * * * * * *}
  110.  
  111. procedure wrapup;
  112.  
  113. {* This is simply an ending procedure to the program. *}
  114.  
  115. begin {* wrapup *}
  116.  
  117.   td_clrscr;
  118.  
  119.   td_writeln('||||');
  120.   td_writeln('      Well, that is about all  there is for  THIS particular  program BUT||');
  121.   td_writeln('    as I pointed out earlier, the  possibilities are many  and due to the||');
  122.   td_writeln('    very loose interface structure of the unit the limits are few.||||');
  123.   
  124.   td_writeln('      If you have ANY questions  or problems, please feel free to contact||');
  125.   td_writeln('    us at our numbers and internet addresses listed in the documentation.||');
  126.  
  127.   td_writeln('      We hope you find  TriDoor as useful, pliable and easy to use  as we||');
  128.   td_writeln('    have.  Good luck and happy programming!||||||');
  129.  
  130. end;  {* wrapup *}
  131.  
  132. {* * * * * * * *}
  133.  
  134. begin {* main procedure *}
  135.  
  136.   clrscr;
  137.  
  138.   if ( read_dorinfo ) then      {* if DORINFO1.DEF exists (and was read)... *}
  139.     begin
  140.  
  141.       if ( setup_tridoor ) then
  142.         begin
  143.  
  144.           example_td_readln;
  145.           example_ANSI;
  146.           wrapup;
  147.  
  148.         end
  149.       else writeln('Error : TriDoor was inable to set-up COMM port.',chr(7));
  150.  
  151.     end
  152.   else writeln('Error : File DORINFO1.DEF not found.',chr(7));
  153.  
  154.  
  155. end.  {* main procedure *}